<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    protected $table = 'order';
    public $timestamps = false;
    protected $guarded = [];
    
    // 查询订单列表
    public function getOrderList($status=1,$opt='=')
    {
        $orders = $this->rightJoin('order_details', 'order.order_number', '=', 'order_details.order_number')
                ->where('order.order_status', 1)
                ->where('order_details.order_status', $opt,$status)
                ->paginate(20);
        return $orders;
    }
}
